package org.tech4j.common.core.model.page;

import org.tech4j.common.utils.NullUtils;

import java.util.Optional;

/**
 * @program: tech4j-common
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/1 21:06
 **/
public class PageQuery {
    private final static int DEFAULT_PAGE_NUM = 1;
    private final static int DEFAULT_PAGE_SIZE = 10;

    /**
     * 当前页数
     */
    private Integer pageNum;

    /**
     * 每页数量
     */
    private Integer pageSize;

    private Boolean count = true;

    public Integer getPageNum() {
        return Optional.ofNullable(pageNum).orElse(DEFAULT_PAGE_NUM);
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return Optional.ofNullable(pageSize).orElse(DEFAULT_PAGE_SIZE);
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Boolean getCount() {
        return count;
    }

    public void setCount(Boolean count) {
        this.count = count;
    }
}
